package cn.t.converter.device;

import cn.t.core.converter.CoreDTOConverter;
import cn.t.dto.device.DeviceDataDTO;
import cn.t.dto.device.vo.OpenCloseDTO;
import cn.t.model.device.DeviceDataDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 设备盘点数据表(DeviceData)dto转domain
 *
 * @author t
 * @since 2024-05-24 10:19:33
 */
@Mapper(componentModel = "spring")
public interface DeviceDataDTOConverter extends CoreDTOConverter<DeviceDataDTO, DeviceDataDO> {

    @Mapping(target = "recordAt", expression = "java(cn.t.utils.DateUtil.dateByStr(openCloseWeightVO.getRecordAt()))")
    DeviceDataDO vo2Do(OpenCloseDTO openCloseWeightVO);
    @Mapping(target = "id", ignore = true)
    DeviceDataDO toCopy(DeviceDataDO dataDO);
}

